/*
 * Powered By [lixin]
 * 代码脚手架工具生成 [AI-Code]
 */

package com.rzhkj.box.dao;

import com.rzhkj.box.entity.Account;
import com.rzhkj.core.base.BaseMybatisDAOImpl;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;


@Repository
public class AccountDAO extends BaseMybatisDAOImpl<Account, Long> {

    /**
     * 加载一个对象Account 通过code
     *
     * @param code 编码
     * @return Account
     */
    public Account loadByCode(java.lang.String code) {
        return getSqlSession().selectOne(this.sqlmapNamespace + ".loadByCode", code);
    }

    /**
     * 更新对象Account 通过code
     *
     * @param code 编码
     * @return Account
     */
    public void updateByCode(Account accountObj, java.lang.String code) {
        if (code != null) {
            accountObj.setCode(code);
        }
        getSqlSession().update(this.sqlmapNamespace + ".update", accountObj);
    }


    /**
     * 删除对象Account
     *
     * @param id id@param code 编码
     * @return Account
     */
    public void delete(java.lang.Long id, java.lang.String code) {
        Map<String, Object> map = new HashMap<String, Object>();
        if (id != null) {
            map.put("id", id);
        }
        if (code != null) {
            map.put("code", code);
        }
        getSqlSession().delete(this.sqlmapNamespace + ".delete", map);
    }


}
